/**
 * Created by Administrator on 2018-07-09.
 * 生产实况
 */
define(function (require,exports,module) {
    var sTpl = require("./productionCase.html");
    require("./productionCase.css");
    var VueComponent = Vue.extend({
        template: sTpl,
        data:function () {
            /*地图迁徙*/
            var geoCoordMap = {
                '上海': [121.4648, 31.2891],
                '东莞': [113.8953, 22.901],
                '东营': [118.7073, 37.5513],
                '中山': [113.4229, 22.478],
                '临汾': [111.4783, 36.1615],
                '临沂': [118.3118, 35.2936],
                '丹东': [124.541, 40.4242],
                '丽水': [119.5642, 28.1854],
                '乌鲁木齐': [87.9236, 43.5883],
                '佛山': [112.8955, 23.1097],
                '保定': [115.0488, 39.0948],
                '兰州': [103.5901, 36.3043],
                '包头': [110.3467, 41.4899],
                '北京': [116.4551, 40.2539],
                '北海': [109.314, 21.6211],
                '南京': [118.8062, 31.9208],
                '南宁': [108.479, 23.1152],
                '南昌': [116.0046, 28.6633],
                '南通': [121.1023, 32.1625],
                '厦门': [118.1689, 24.6478],
                '台州': [121.1353, 28.6688],
                '合肥': [117.29, 32.0581],
                '呼和浩特': [111.4124, 40.4901],
                '咸阳': [108.4131, 34.8706],
                '哈尔滨': [127.9688, 45.368],
                '唐山': [118.4766, 39.6826],
                '嘉兴': [120.9155, 30.6354],
                '大同': [113.7854, 39.8035],
                '大连': [122.2229, 39.4409],
                '天津': [117.4219, 39.4189],
                '太原': [112.3352, 37.9413],
                '威海': [121.9482, 37.1393],
                '宁波': [121.5967, 29.6466],
                '宝鸡': [107.1826, 34.3433],
                '宿迁': [118.5535, 33.7775],
                '常州': [119.4543, 31.5582],
                '广州': [113.5107, 23.2196],
                '廊坊': [116.521, 39.0509],
                '延安': [109.1052, 36.4252],
                '张家口': [115.1477, 40.8527],
                '徐州': [117.5208, 34.3268],
                '德州': [116.6858, 37.2107],
                '惠州': [114.6204, 23.1647],
                '成都': [103.9526, 30.7617],
                '扬州': [119.4653, 32.8162],
                '承德': [117.5757, 41.4075],
                '拉萨': [91.1865, 30.1465],
                '无锡': [120.3442, 31.5527],
                '日照': [119.2786, 35.5023],
                '昆明': [102.9199, 25.4663],
                '杭州': [119.5313, 29.8773],
                '枣庄': [117.323, 34.8926],
                '柳州': [109.3799, 24.9774],
                '株洲': [113.5327, 27.0319],
                '武汉': [114.3896, 30.6628],
                '汕头': [117.1692, 23.3405],
                '江门': [112.6318, 22.1484],
                '沈阳': [123.1238, 42.1216],
                '沧州': [116.8286, 38.2104],
                '河源': [114.917, 23.9722],
                '泉州': [118.3228, 25.1147],
                '泰安': [117.0264, 36.0516],
                '泰州': [120.0586, 32.5525],
                '济南': [117.1582, 36.8701],
                '济宁': [116.8286, 35.3375],
                '海口': [110.3893, 19.8516],
                '淄博': [118.0371, 36.6064],
                '淮安': [118.927, 33.4039],
                '深圳': [114.5435, 22.5439],
                '清远': [112.9175, 24.3292],
                '温州': [120.498, 27.8119],
                '渭南': [109.7864, 35.0299],
                '湖州': [119.8608, 30.7782],
                '湘潭': [112.5439, 27.7075],
                '滨州': [117.8174, 37.4963],
                '潍坊': [119.0918, 36.524],
                '烟台': [120.7397, 37.5128],
                '玉溪': [101.9312, 23.8898],
                '珠海': [113.7305, 22.1155],
                '盐城': [120.2234, 33.5577],
                '盘锦': [121.9482, 41.0449],
                '石家庄': [114.4995, 38.1006],
                '福州': [119.4543, 25.9222],
                '秦皇岛': [119.2126, 40.0232],
                '绍兴': [120.564, 29.7565],
                '聊城': [115.9167, 36.4032],
                '肇庆': [112.1265, 23.5822],
                '舟山': [122.2559, 30.2234],
                '苏州': [120.6519, 31.3989],
                '莱芜': [117.6526, 36.2714],
                '菏泽': [115.6201, 35.2057],
                '营口': [122.4316, 40.4297],
                '葫芦岛': [120.1575, 40.578],
                '衡水': [115.8838, 37.7161],
                '衢州': [118.6853, 28.8666],
                '西宁': [101.4038, 36.8207],
                '西安': [109.1162, 34.2004],
                '贵阳': [106.6992, 26.7682],
                '连云港': [119.1248, 34.552],
                '邢台': [114.8071, 37.2821],
                '邯郸': [114.4775, 36.535],
                '郑州': [113.4668, 34.6234],
                '鄂尔多斯': [108.9734, 39.2487],
                '重庆': [107.7539, 30.1904],
                '金华': [120.0037, 29.1028],
                '铜川': [109.0393, 35.1947],
                '银川': [106.3586, 38.1775],
                '镇江': [119.4763, 31.9702],
                '长春': [125.8154, 44.2584],
                '长沙': [113.0823, 28.2568],
                '长治': [112.8625, 36.4746],
                '阳泉': [113.4778, 38.0951],
                '青岛': [120.4651, 36.3373],
                '韶关': [113.7964, 24.7028]
            };
            var KMDataTop3=[ ];
            var KMData = [
                [{
                    name: '昆明'
                }, {
                    name: '上海',
                    value: 110
                }],
                [{
                    name: '昆明'
                }, {
                    name: '乌鲁木齐',
                    value: 10
                }],
                [{
                    name: '昆明'
                }, {
                    name: '大连',
                    value: 80
                }],
                [{
                    name: '南宁'
                }, {
                    name: '昆明',
                    value: 70
                }],
                [{
                    name: '昆明'
                }, {
                    name: '南昌',
                    value: 60
                }],
                [{
                    name: '昆明'
                }, {
                    name: '拉萨',
                    value: 50
                }],
                [{
                    name: '昆明'
                }, {
                    name: '长春',
                    value: 40
                }],
                [{
                    name: '昆明'
                }, {
                    name: '包头',
                    value: 30
                }],
                [{
                    name: '昆明'
                }, {
                    name: '重庆',
                    value: 20
                }]

            ];

            var planePath = 'path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z';

            var convertData = function(data) {
                var res = [];
                // for (var i = 0; i < data.length; i++) {
                //     var dataItem = data[i];
                //     var fromCoord = geoCoordMap[dataItem[0].name];
                //     var toCoord = geoCoordMap[dataItem[1].name];
                //     if (fromCoord && toCoord) {
                //         res.push([{
                //             coord: fromCoord
                //         }, {
                //             coord: toCoord
                //         }]);
                //     }
                // }
                var fromCoord = geoCoordMap[data[0].name];
                var toCoord = geoCoordMap[data[1].name];
                if (fromCoord && toCoord) {
                    res.push([{
                        coord: fromCoord
                    }, {
                        coord: toCoord
                    }]);
                }
                return res;
            };

            var colors = ['#ffa022','#e9c600','#0000ff','#5555ff','#aaaaff'];
             var series = [{type: "map", Type: "china"}];
             var lend = [];
            // [['昆明',KMData],['昆明',KMDataTop3]
            // ]
            KMData.sort(function (val,val2) {
               val.value >val2.value?1:-1;
            });

             KMData.forEach(function(item, i) {

                 var name =  ' Top'+(i+1)+(item[0].name=="昆明"?item[1].name:item[0].name);
                 var label = name;
                 if(i<5){
                     lend.push({name:name,textStyle:{

                     }});
                 }else{
                     return;
                     // if(i==3){
                     //     lend.push({name:'其他',textStyle:{
                     //
                     //     }});
                     // }
                     // name='其他'
                 }
                 var color=i<5?colors[i]:colors[4];

                series.push({

                    name: name,
                    type: 'lines',
                    zlevel: 1,
                    effect: {
                        show: true,
                        period: 6,
                        trailLength: 0.7,
                        color: '#fff',
                        symbolSize: 3
                    },

                    lineStyle: {
                        normal: {
                            color: color,
                            width: 0,
                            curveness: 0.2
                        }
                    },
                    data: convertData(item)
                }, {
                    name: name,
                    type: 'lines',

                    zlevel: 2,
                    effect: {
                        show: true,
                        period: 6,
                        trailLength: 0,
                        symbol: planePath,
                        symbolSize: 15
                    },
                    lineStyle: {
                        normal: {
                            color: color,
                            width: 1,
                            opacity: 0.4,
                            curveness: 0.2
                        }
                    },
                    data: convertData(item)
                }, {
                    name:name,
                    type: 'effectScatter',
                    coordinateSystem: 'geo',
                    zlevel: 2,
                    rippleEffect: {
                        brushType: 'stroke'
                    },
                    label: {
                        normal: {
                            show: true,
                            position: 'right',
                            formatter: '{b}'
                        }
                    },
                    symbolSize: function(val) {
                        return val[2] / 8;
                    },
                    itemStyle: {
                        normal: {
                            color: color
                        }
                    },
                    data: [{
                        name: item[0].name=="昆明"?" ":item[0].name,
                        value: geoCoordMap[item[0].name].concat([item[0].value])
                    },{
                        name: item[1].name=="昆明"?"":item[1].name,
                        value: geoCoordMap[item[1].name].concat([item[1].value])
                    }]
                    // item[1].map(function(dataItem) {
                    //     return {
                    //         name: dataItem[1].name,
                    //         value: geoCoordMap[dataItem[1].name].concat([dataItem[1].value])
                    //     };
                    // })
                });
            });
          /*-----------------------------------------------------------------------------------*/
            return {
                jsLoaded:false,
                /*迁徙数据*/
                lend:lend,
                series:series,

                /*当月每日架次*/
                mouthSortie:[4,3,5,8,6,12,4,15,4,3,6,0,2,9,21,4,14,6,8,4,17,1,20,13,13,24,9,26,8,12,7],
                yearSortie:[100,121,98,134,50,233,102,214,148,123,234,77],
                size:{width: '100px', height: '400px'},
                sortieNumDay:8,
                sortieNumMonth:203,
                sortieNumYear:2400,
                totalAtcYear:0.0,
                totalAtcMonth:0.0,
                totalAtcDay:0.0,
                data1: [0,0,2, 7,4,5, 2,0],
                atcYearData:[{
                    unit:'MU5848',
                    atcYear:100
                },{
                    unit:'SD4568',
                    atcYear:200
                },{
                    unit:'BH3467',
                    atcYear:300
                }
                    ,{
                        unit:'BJ4256',
                        atcYear:400
                    }
                    ,{
                        unit:'JK7825',
                        atcYear:500
                    }

                ],
                atcMonthData:[{
                    unit:'MU5848',
                    atcMonth:11
                },{
                    unit:'SD4568',
                    atcMonth:20
                },{
                    unit:'BH3467',
                    atcMonth:30
                }
                    ,{
                        unit:'BJ4256',
                        atcMonth:40
                    }
                ],
                atcDayData:[{
                    unit:'MU5848',
                    atcDay:2
                },{
                    unit:'SD4568',
                    atcDay:1
                },{
                    unit:'BH3467',
                    atcDay:2
                },
                    {
                        unit:'BJ4256',
                        atcDay:1
                    }
                    ,
                    {
                        unit:'JK7825',
                        atcDay:3
                    }
                    ,
                    {
                        unit:'CD7483',
                        atcDay:1
                    }
                ],
                rankingListData:[
                    {
                    unit:'MU5848',
                    type:'91',
                    airName: 3,
                    flyingCadet:0,
                    aviator:8
                    },
                    {
                    unit:'SD4568',
                    type:'91',
                    airName: 1,
                    flyingCadet:0,
                    aviator:3
                    },
                    {
                    unit:'BH3467',
                    type:'91',
                    airName: 4,
                    flyingCadet:0,
                    aviator:4
                    },
                    {
                    unit:'BJ4256',
                    type:'91',
                    airName: 12,
                    flyingCadet:0,
                    aviator:17
                    },
                    {
                    unit:'JK7825',
                    type:'91',
                    airName: 2,
                    flyingCadet:0,
                    aviator:3
                    },
                    {
                    unit:'CD7483',
                    type:'91',
                    airName: 3,
                    flyingCadet:0,
                    aviator:6
                    },
                    {
                    unit:'AC2345',
                    type:'91',
                    airName: 3,
                    flyingCadet:0,
                    aviator:3
                    }],
                /*上月飞行量数据*/
                tableDataMonth:[{
                    unit: 'AC2345',
                    airType: 'CTN-23',
                    sortie: 23,
                    flightDays:23,
                    monthPlan:'24'
                }, {
                    unit: 'CD7483',
                    airType: 'WEC-45',
                    sortie:15,
                    flightDays:12,
                    monthPlan:'18'
                }, {
                    unit: 'JK7825',
                    airType: 'QWE-21',
                    sortie:23,
                    flightDays:23,
                    monthPlan:'33'
                }
                    , {
                        unit: 'BJ4256',
                        airType: 'CTN-23',
                        sortie:30,
                        flightDays:23,
                        monthPlan:'40'
                    }, {
                        unit: 'BH3467',
                        airType: 'CTN-23',
                        sortie:10,
                        flightDays:7,
                        monthPlan:'23'
                    }, {
                        unit: 'SD4568',
                        airType: 'CTN-23',
                        sortie:11,
                        flightDays:7,
                        monthPlan:'50'
                    }
                    , {
                        unit: 'MU5848',
                        airType: 'CTN-23',
                        sortie:42,
                        flightDays:28,
                        monthPlan:'42'
                    }
                ],
                /*去年飞行量数据*/
                tableDataYear:[{
                    unit: 'AC2345',
                    airType: 'CTN-23',
                    sortie:230,
                    flightDays:180,
                    yearPlan:'240'
                }, {
                    unit: 'CD7483',
                    airType: 'WEC-45',
                    sortie: 220,
                    flightDays:160,
                    yearPlan:'300'
                }, {
                    unit: 'JK7825',
                    airType: 'QWE-21',
                    sortie: 230,
                    flightDays:230,
                    yearPlan:'310'
                }
                    , {
                        unit: 'BJ4256',
                        airType: 'CTN-23',
                        sortie: 100,
                        flightDays:90,
                        yearPlan:'120'
                    }, {
                        unit: 'BH3467',
                        airType: 'CTN-23',
                        sortie: 100,
                        flightDays:80,
                        yearPlan:'130'
                    }, {
                        unit: 'SD4568',
                        airType: 'CTN-23',
                        sortie: 100,
                        flightDays:78,
                        yearPlan:'100'
                    }
                    , {
                        unit: 'MU5848',
                        airType: 'CTN-23',
                        sortie: 100,
                        flightDays:100,
                        yearPlan:'120'
                    }
                ],


              
            }



        },
        methods: {
            tabClick:function(a){
                if(a.paneName==='1'){
                    this.$nextTick(function () {
                        this.atcDaysM();
                        this.fPFTM();
                        this.flightFactorsM();
                        this.mapMigrM();
                    }.bind(this));
                }
                if(a.paneName==='2'){
                    this.$nextTick(function () {
                        this.atcMouthsY();
                        this.fPFTY();
                        this.flightFactorsY();
                        this.mapMigrY();
                    }.bind(this));

                }
            },
            totalAtc:function () {
                var yTotal=0.0;
                var mTotal=0.0;
                var dTotal=0.0;
                /*年总量*/
                for(var i=0;i<this.atcYearData.length;i++){

                    yTotal+=this.atcYearData[i].atcYear;
                }
                this.totalAtcYear=yTotal;
                /*月总量*/
                for(var i=0;i<this.atcMonthData.length;i++){

                   mTotal+=this.atcMonthData[i].atcMonth;

                }
                this.totalAtcMonth=mTotal;
                /*日总量*/
                for(var i=0;i<this.atcDayData.length;i++){

                    dTotal+=this.atcDayData[i].atcDay;

                }
                this.totalAtcDay=dTotal;
            },

          /*昨日机型飞行时数*/
            fPFT: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('flightForYesterday'))
                // 绘制图表
                myChart.setOption({
                    title : {
                        text: '昨日机型飞行时数',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14',
                        }

                    },
                    color:['#9bc608','#ef5b5b','#00d8da','#8661aa','#ffbd00','#c85567'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    series : [
                        {
                            name:'飞行时数',
                            type:'pie',
                            radius : [30, 110],
                            center : ['50%', '50%'],
                            roseType : 'area',
                            data: [
                                {value: 11, name: 'DA-40'},
                                {value: 44, name: 'DA-42'},
                                {value: 55, name: 'PA-44'},
                                {value: 6, name: 'C-172'},
                                {value: 78, name: 'AS-350'},
                                {value: 23, name: 'PA-75'}
                            ]
                        }
                    ]
                });
            },

            /*昨日时段飞行时数*/
            atcHours: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('atcHours'))
                // 绘制图表
                myChart.setOption({
                    title: {
                        text: '昨日飞行时数',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14'
                        }

                    },
                    tooltip : {
                        trigger: 'axis',
                        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },
                    grid: {
                        left: '5%',
                        right: '15%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            name :'时间段',
                            type : 'category',
                            data: ['0-2', '3-5', '6-8', '9-11', '12-14', '15-17', '18-20', '21-23'],
                            axisTick: {
                                alignWithLabel: true
                            },
                            nameTextStyle:{
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#0177d4'
                                }
                            },
                            axisLabel: {
                                color:'#00FFFF',
                                fontSize:'12',
                            }

                        }
                    ],
                    yAxis : [
                        {
                            name :'时数',
                            type : 'value',
                            nameTextStyle:{
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#0177d4'
                                }
                            },
                            axisLabel: {
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            splitLine:{
                            show:false
                            }


                        }
                    ],
                    series : [
                        {
                            name:'时数',
                            type:'bar',
                            barWidth: 18,
                            itemStyle:{
                                normal:{
                                    color:new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                        offset: 0,
                                        color: '#00b0ff'
                                    }, {
                                        offset: 0.8,
                                        color: '#7052f4'
                                    }], false)
                                }
                            },
                            data:this.data1
                        }
                    ]
                });
            },

            /*飞行影响分析*/
            flightFactors: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('flightFactors'))
                // 绘制图表
                myChart.setOption({
                    title : {
                        text: '飞行影响分析',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14',
                        }
                    },
                    color:['#ef5b5b','#00d8da','#8661aa','#f6ac1c','#c85567'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    series : [
                        {
                            name:'影响因素',
                            type:'pie',
                            radius : [30, 110],
                            center : ['50%', '50%'],
                            roseType : 'area',
                            data: [
                                {value: 10, name: '天气'},
                                {value: 7, name: '军演'},
                                {value: 9, name: '故障'},
                                {value: 6, name: '机场限制'}
                            ]
                        }
                    ]
                });
            },
            mapMigr: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('mapMigr'))
                // 绘制图表
                myChart.setOption({
                    backgroundColor: '#282840',
                    title: {
                        text: '昨日航线',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14',
                        }
                    },
                    tooltip: {
                        trigger: 'item'
                    },

                    legend: {
                        orient: 'vertical',
                        top: 'bottom',
                        left: 'left',
                        data:this.lend,
                        textStyle: {
                            color: '#fff'
                        },
                        selectedMode: 'multiple'
                    },
                    geo: {
                        map: 'china',
                        label: {
                            emphasis: {
                                show: false
                            }
                        },
                        roam: true,
                        itemStyle: {
                            normal: {
                                areaColor: '#323c48',
                                borderColor: '#404a59'
                            },
                            emphasis: {
                                areaColor: '#2a333d'
                            }
                        }
                    },
                    series: this.series
                });
            },


            /* ------------------------------------------月报------------------------------------------------*/

            /*本月机型飞行时数*/
            fPFTM: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('flightForMonth'))
                // 绘制图表
                myChart.setOption({
                    title : {
                        text: '上月飞行时数',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14',
                        }
                    },
                    color:['#9bc608','#ef5b5b','#00d8da','#8661aa','#ffbd00','#c85567'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    series : [
                        {
                            name:'飞行时数',
                            type:'pie',
                            radius : [30, 110],
                            center : ['50%', '50%'],
                            roseType : 'area',
                            data: [
                                {value: 11, name: 'DA-40'},
                                {value: 44, name: 'DA-42'},
                                {value: 55, name: 'PA-44'},
                                {value: 6, name: 'C-172'},
                                {value: 78, name: 'AS-350'},
                                {value: 23, name: 'PA-75'}
                            ]
                        }
                    ]
                });
            },
            /*飞行影响分析*/
            flightFactorsM: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('flightFactorsM'))
                // 绘制图表
                myChart.setOption({
                    title : {
                        text: '上月飞行影响分析',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14',
                        }
                    },
                    color:['#ef5b5b','#00d8da','#8661aa','#f6ac1c','#c85567'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    series : [
                        {
                            name:'影响因素',
                            type:'pie',
                            radius : [30, 110],
                            center : ['50%', '50%'],
                            roseType : 'area',
                            data: [
                                {value: 10, name: '天气'},
                                {value: 7, name: '军演'},
                                {value: 9, name: '故障'},
                                {value: 6, name: '机场限制'}
                            ]
                        }
                    ]
                });
            },
            /*本月日飞行时数*/
            atcDaysM: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('atcDaysM'))
                // 绘制图表
                myChart.setOption({
                    title: {
                        text: '上月日飞行时数',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14'
                        }
                    },
                    tooltip : {
                        trigger: 'axis',
                        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },
                    grid: {
                        left: '5%',
                        right: '10%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            name :'日期',
                            type : 'category',
                            data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13',
                                    '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26',
                                    '27', '28', '29', '30', '31'],
                            axisTick: {
                                alignWithLabel: true
                            },
                            nameTextStyle:{
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#0177d4'
                                }
                            },
                            axisLabel: {
                                color:'#00FFFF',
                                fontSize:'12',
                            }
                        }
                    ],
                    yAxis : [
                        {
                            name :'飞行时数',
                            type : 'value',
                            nameTextStyle:{
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#0177d4'
                                }
                            },
                            axisLabel: {
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            splitLine:{
                                show:false
                            }

                        }

                    ],
                    series : [
                        {
                            name:'时数',
                            type:'bar',
                            barWidth: 8,
                            itemStyle:{
                                normal:{
                                    color:new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                        offset: 0,
                                        color: '#00b0ff'
                                    }, {
                                        offset: 0.8,
                                        color: '#7052f4'
                                    }], false)
                                }
                            },
                            data:this.mouthSortie
                        }
                    ]
                });
            },

            /*本月航线*/

            mapMigrM: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('mapMigrM'))
                // 绘制图表
                myChart.setOption({
                    backgroundColor: '#282840',
                    title: {
                        text: '上月热点航线图',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14'
                        }
                    },
                    tooltip: {
                        trigger: 'item'
                    },

                    legend: {
                        orient: 'vertical',
                        top: 'bottom',
                        left: 'left',
                        data: this.lend,
                        textStyle: {
                            color: '#fff'
                        },
                        selectedMode: 'multiple'
                    },
                    geo: {
                        map: 'china',
                        label: {
                            emphasis: {
                                show: false
                            }
                        },
                        roam: true,
                        itemStyle: {
                            normal: {
                                areaColor: '#323c48',
                                borderColor: '#404a59'
                            },
                            emphasis: {
                                areaColor: '#2a333d'
                            }
                        }
                    },
                    series: this.series
                });
            },

            /*------------------------------------------年报--------------------------------------------------------*/

            /*本年机型飞行时数*/
            fPFTY: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('flightForYear'))
                // 绘制图表
                myChart.setOption({
                    title : {
                        text: '本年机型飞行时数',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14',
                        }
                    },
                    color:['#9bc608','#ef5b5b','#00d8da','#8661aa','#ffbd00','#c85567'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    series : [
                        {
                            name:'飞行时数',
                            type:'pie',
                            radius : [30, 110],
                            center : ['50%', '50%'],
                            roseType : 'area',
                            data: [
                                {value: 120, name: 'DA-40'},
                                {value: 450, name: 'DA-42'},
                                {value: 600, name: 'PA-44'},
                                {value: 74, name: 'C-172'},
                                {value: 700, name: 'AS-350'},
                                {value: 250, name: 'PA-75'}
                            ]
                        }
                    ]
                });
            },
            /*本年飞行影响分析*/
            flightFactorsY: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('flightFactorsY'))
                // 绘制图表
                myChart.setOption({
                    title : {
                        text: '本年飞行影响分析',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14',
                        }
                    },
                    color:['#ef5b5b','#00d8da','#8661aa','#f6ac1c','#c85567'],
                    tooltip : {
                        trigger: 'item',
                        formatter: "{a} <br/>{b} : {c} ({d}%)"
                    },
                    series : [
                        {
                            name:'影响因素',
                            type:'pie',
                            radius : [30, 110],
                            center : ['50%', '50%'],
                            roseType : 'area',
                            data: [
                                {value: 10, name: '天气'},
                                {value: 7, name: '军演'},
                                {value: 9, name: '故障'},
                                {value: 6, name: '机场限制'}
                            ]
                        }
                    ]
                });
            },
            /*本年月飞行量*/
            atcMouthsY: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('atcMouthsY'))
                // 绘制图表
                myChart.setOption({
                    title: {
                        text: '本年每月飞行时数',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14'
                        }

                    },
                    tooltip : {
                        trigger: 'axis',
                        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
                            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
                        }
                    },
                    grid: {
                        left: '5%',
                        right: '10%',
                        bottom: '3%',
                        containLabel: true
                    },
                    xAxis : [
                        {
                            name :'月份',
                            type : 'category',
                            data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'],
                            axisTick: {
                                alignWithLabel: true
                            },
                            nameTextStyle:{
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#0177d4'
                                }
                            },
                            axisLabel: {
                                color:'#00FFFF',
                                fontSize:'12',
                            }
                        }
                    ],
                    yAxis : [
                        {
                            name :'飞行时数',
                            type : 'value',
                            nameTextStyle:{
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            axisLine: {
                                lineStyle: {
                                    color: '#0177d4'
                                }
                            },
                            axisLabel: {
                                color:'#00FFFF',
                                fontSize:'12',
                            },
                            splitLine:{
                                show:false
                            }

                        }

                    ],
                    series : [
                        {
                            name:'时数',
                            type:'bar',
                            barWidth: 8,
                            itemStyle:{
                                normal:{
                                    color:new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                                        offset: 0,
                                        color: '#00b0ff'
                                    }, {
                                        offset: 0.8,
                                        color: '#7052f4'
                                    }], false)
                                }
                            },
                            data:this.yearSortie
                        }
                    ]
                });
            },
            /*本年时段飞行时数*/

            loadJs:function () {
                var $this = this;
                require.async("../../lib/echarts.min.js",function (data) {
                    require.async("../../lib/china.js", function (data) {
                        $this.jsLoaded=true;
                    });
                });
            },
            mapMigrY: function () {
                // 基于准备好的dom，初始化echarts实例
                var myChart = echarts.init(document.getElementById('mapMigrY'))
                // 绘制图表
                myChart.setOption({
                    backgroundColor: '#282840',
                    title: {
                        text: '本年热点航线图',
                        x:'left',
                        textStyle:{
                            color:'#00FFFF',
                            fontSize:'14'
                        }
                    },
                    tooltip: {
                        trigger: 'item'
                    },

                    legend: {
                        orient: 'vertical',
                        top: 'bottom',
                        left: 'left',
                        data:this.lend,
                        textStyle: {
                            color: '#fff'
                        },
                        selectedMode: 'multiple'
                    },
                    geo: {
                        map: 'china',
                        label: {
                            emphasis: {
                                show: false
                            }
                        },
                        roam: true,
                        itemStyle: {
                            normal: {
                                areaColor: '#323c48',
                                borderColor: '#404a59'
                            },
                            emphasis: {
                                areaColor: '#2a333d'
                            }
                        }
                    },
                    series: this.series
                });
            }







        },
        computed:{

        },
        mounted:function() {

        },
        watch:{
            jsLoaded:function (nv,ov) {
                if(nv){
                    this.$nextTick(function () {
                        this.atcHours();
                        this.fPFT();
                        this.flightFactors();
                        this.mapMigr();

                    }.bind(this));
                }
            }
        },
        created:function () {
            this.loadJs();
            this.totalAtc();

        },
        activated:function () {
            messages.$emit('change','生产实况');
        }

    })
    module.exports=VueComponent;
    module.exports.reDefine=function (val) {
        module.exports.type=val;
        return module.exports;
    }

})

